<?php 
// +----------------------------------------------------------------------
// | ThinkPHP                                                             
// +----------------------------------------------------------------------
// | Copyright (c) 2008 http://thinkphp.cn All rights reserved.      
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>                                  
// +----------------------------------------------------------------------
// $Id$

function toDate($time,$format='Y-m-d H:i:s') 
{
	if( empty($time)) {
		return '';
	}
    $format = str_replace('#',':',$format);
	return date(auto_charset($format),$time);
}

function getStatus($status) 
{
    switch($status) {
    	case 1:
            $showText   = '<span class="red">充值成功</span>';
            break;
        case -1:
			$showText = '充值失败';
        default:
            $showText   =   '充值过程发生意外';
            
    }
    return $showText;
}
function getUserURL($uid){
	$user = D("User");
	$data = $user->table("joying_user u")->join("joying_form f on f.uid=u.id")->where("u.id={$uid}")->findAll();
	$allurl = "";
	foreach ($data as $dat){
		$allurl.=($dat['id'].",");
	}
	return substr($allurl,0,-1);
}
?>